<?php $this->deleteByCheckbox('.deleteSubject',$this->baseUrl() . '/subject/delete','.message');?>
<div class="adminPanel">
	<div class="toolboxImg icon-subject">Správa predmetov</div>
	<div class="toolbox">
		<table class="toolbox">
			<tr>
				<td>				
					<a href="<?php echo  $this->url(array('controller' => 'subject','action' => 'add'))?>">
						<div class="icon addSubject"></div>
						Pridať
					</a>
				</td>
				<td>
					<a href="#" class="deleteSubject">
						<div class="icon delete"></div>
						Odstrániť
					</a>
				</td>
			</tr>
		</table>
	</div>
	<div class="clear"></div>
</div>
<div class="message"></div>
<form name="checkbox">
<table>
<tr>	
	<th></th>
	<th>Meno predmetu</th>
	<th>Počet otázok</th>
	<th></th>	
</tr>
<?php 
	$i = 0;
	foreach ($this->subjects as $subject):
	$i++;
	$class = ($i % 2 == 0) ? 'class="even"' : '';
?>
	<tr id="<?php echo $subject->sid ?>" <?php echo $class ?>>
		<td class="center"><input type="checkbox" name="<?php echo $subject->sid ?>" value="<?php echo $subject->sid ?>"></td>
		<td class="left"><?php echo $subject->name ?></td>
		<td class="right"><?php echo $this->questionsCount[$subject->sid] ?></td>
		<td class="center"><a class="actionIcon editAction" href="<?php echo $this->url(array(
					'controller' => 'question',
					'action' => 'index',
					'sid' => $subject->sid
				))?>">Spravovať otázky</a>
		</td>
<?php endforeach;?>
</table>
</form>